﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace AssemblyExplorer
{
    public partial class AssemblyDisplay : Form
    {
        AssemblyReader reader;
        public AssemblyDisplay(String fileName)
        {
            
            InitializeComponent();
            Read(fileName);
        }

        private void AssemblyDisplayCloseButton_Click(object sender, EventArgs e)
        {
            this.Close();
            this.Dispose();
        }

        private void displayListView_MouseDoubleClick(object sender, EventArgs e)
        {
            string[] info = reader.GetClassMethods(displayListView.FocusedItem.Text);
            MethodsDisplay display = new MethodsDisplay(info);
            //Send the class we selected to the display before we show
            display.ClassName = displayListView.FocusedItem.Text;
            display.Show();
            //MessageBox.Show(displayListView.FocusedItem.Text); //The Class Name
        }

        private void Read(String fileName)
        {
            reader = new AssemblyReader(this, fileName);
            reader.ExploreAssembly();
            //Convert all this crap to listviews
        }

        private void AssemblyDisplay_Load(object sender, EventArgs e)
        {

        }
    }
}
